package com.zoe.onelink.business.property;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashSet;
import java.util.Set;

/**
 * <p>标题: </p>
 * <p>描述: </p>
 * <p>版权: Copyright (c) 2022</p>
 * <p>公司: 智业软件股份有限公司</p>
 *
 * @version: 1.0
 * @author: ruansheng
 * @date: 2022-05-07
 */
@Data
@ConfigurationProperties(prefix = "onelink.biz")
public class OnelinkBizProperties {

    private BizParam bizParam = new BizParam();

    @Data
    public static class BizParam {

        /**
         * 开启本地缓存
         */
        private boolean localCacheEnabled = true;

        /**
         * 策略
         */
        private BizParamStrategy strategy = BizParamStrategy.COMBINATION;

        /**
         * 打印业务参数获取日志
         */
        private boolean logEnabled = true;

        /**
         * 自动同步业务参数
         */
        private boolean autoInit = false;

        /**
         * 不使用缓存的Key列表
         */
        private Set<String> localCacheExcludeList = new HashSet<>();

        /**
         * WSRequestUtil 最大并发数 (默认50)
         */
        private int wsMaxRequestCount = 50;


    }

    /**
     * 业务参数缓存策略
     */
    public enum BizParamStrategy {
        OPTIMUS,
        COMBINATION
    }

}
